var status = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}
 
function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0 && status == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
		cm.sendNext("Hey, your team is " + cm.getTeam());
	} else {
		cm.setBlue();
		cm.sendOk("Your team is now " + cm.getTeam());
		cm.dispose();
	}
    }
}